import java.util.Date;
import java.util.Calendar;
import java.util.GregorianCalendar;

public class EmployeeTest {

  public static void main(String[] args) {
    Employee[] staff = new Employee[3];

    staff[0] = new Employee("Carl Cracker", 75000, 1987, 12, 15);
    staff[1] = new Employee("Harry Hacker", 50000, 1989, 10, 1);
    staff[2] = new Employee("Tony Tester", 40000, 1990, 3, 15);

    for (Employee e : staff) {
      e.raiseSalary(5);
    }

    for (Employee e : staff) {
      System.out.println(e.toString());
    }

  }

}


class Employee {

  private String name;
  private double salary;
  private Date hireDay;

  public Employee(String name, double salary, int year, int month, int day) {
    this.name = name;
    this.salary = salary;
    this.hireDay = new GregorianCalendar(year, month - 1, day).getTime();
  }

  public String getName() {
    return this.name;
  }

  public double getSalary() {
    return this.salary;
  }

  public Date getHireDay() {
    return hireDay;
  }

  public void raiseSalary(double byPrecent) {
    this.salary += this.salary * byPrecent / 100;
  }

  public String toString() {
    StringBuilder builder = new StringBuilder();

    builder.append("Name: ");
    builder.append(this.name);

    builder.append("\nSalary: ");
    builder.append(String.format("%7.2f", this.salary));

    builder.append("\nHire Day: ");


    GregorianCalendar calendar = new GregorianCalendar();
    calendar.setTime(this.hireDay);

    builder.append(calendar.get(Calendar.YEAR));
    builder.append("/");
    builder.append(calendar.get(Calendar.MONTH));
    builder.append("/");
    builder.append(calendar.get(Calendar.DAY_OF_MONTH));
    builder.append("\n");

    return builder.toString();
  }

}
